<template>
  <div>
    <QRCode :wallet="wallet" />
    <div v-if="wallet.id !== 'walletConnect'" style="display: flex; justify-content: space-between; margin-top: 12px">
      <div> Don't have {{ wallet.name }}? </div>
      <button @click="() => emits('get')"> GET </button>
    </div>
    <div v-else style="display: flex; justify-content: space-between; margin-top: 12px">
      <div> Need the official WalletConnect modal? </div>
      <button @click="() => emits('open')"> OPEN </button>
    </div>
  </div>
</template>
<script setup lang="ts">
  import QRCode from '../QRCode/index.vue'
  import type { WalletConnector } from '../../wallets/useWalletConnectors'

  withDefaults(
    defineProps<{
      wallet: WalletConnector
    }>(),
    {}
  )

  const emits = defineEmits(['get', 'open'])
</script>

<style lang="scss" scoped>
  button {
    cursor: pointer;
    padding: 4px 12px;
    transition: all 0.3s ease;
    border: none;
    background: #d9fc01;
    color: #1a1b1f;
    border-radius: 24px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: -0.05em;
    line-height: 16px;
    &:hover {
      transform: scale(1.05);
    }
    &:active {
      transform: scale(0.95);
    }
  }
</style>
